#include <bits/stdc++.h>
using namespace std;
#define N 10005
template<class T>
struct Node
{
	T val;
	int next;
};
template<class T>
class Queue
{
private:
	Node<T> node[N];
	int p, tail, head;
public:
	Queue()
	{
		p = 1;
		head = p++;
		tail = head;
	}
	void push(T a)
	{
		int np = p++;
		node[np].val = a;
		node[tail].next = np;
		tail = np;
	}
	void pop()
	{
		int fp = node[head].next;
		node[head].next = node[fp].next;
		if(fp == tail)
			tail = head;
	}
	T front()
	{
		return node[node[head].next].val;
	}
	T back()
	{
		return node[tail].val;
	}
	bool empty() 
	{
		return head == tail;
	}
};
int main()
{
    Queue<int> que;
    int n;
    cin >> n;
	for(int i = 1; i <= n; ++i)
		que.push(i);
	while(que.empty() == false)
	{
		cout << que.front() << ' ';
		que.pop();
	}
	cout << endl;
	for(int i = 1; i <= n; ++i)
		que.push(i);
	while(que.empty() == false)
	{
		cout << que.front() << ' ';
		que.pop();
	}
    return 0;
}
